<?php
/**
 * 商品类型模型
 * @author e5
 *
 */
class TypeModel extends Model{
	public $table = "type";
	public $validate = array(
			array("tname","nonull","类型名称不能为空",2,3),
			array("tname","maxlen:20","类型名称最大长度为20个字符",2,3),
	);
	/**
	 * 添加类型
	 * @return boolean
	 */
	public function addType(){
		if (!$this->create()) return false;
		return $this->add();
	}
	/**
	 * 编辑类型
	 * @return boolean
	 */
	public function editType(){
		if (!$this->create()) return false;
		$this->update();
		return true;
	}
}